/**
 * 查询组件“集散组件”
 * by zhangxinyue
 * create 2020.08.19
 * update 2021.08.30 将查询和重置设置在整行的右侧，而不是下一个栅格的右侧
 */
import React from 'react';
import {
  DATA_ENTRY,
  InputC,
  SelectC,
  InputNumberC,
  TreeSelectC,
  RangeSelectC,
  SingleDateC,
  RangeDateC,
  ComplexDateC,
  SimpleWeekC,
  SimpleQuarterC,
  SimpleRangeDateC,
  FormOtherC,
} from '../form';
import {
  WinBondTypeC,
  ProductGroupTreeC,
  ProductListC,
  ProductGroupSepC,
  SecuritiesCodeC,
  BenchMarkC,
  SeriesProductsC,
  TradingCompanyC,
  TradingDirectC,
  TradingMarketC,
  TradingTypeC,
  ProductGroupC,
  TenantC,
  TenantDepartmentC,
  RateRangeC,
  IndustryC,
  SeriesProductGroupC,
  FundApplicationIndustryC,
  SppIResultC,
  // BusinessTypeC,
  BusinessTargetC,
  AddressC,
  SearchAndSelectC,
  HoldDateRangeC,
} from '../business';

const FormItems = (props) => {
  // console.log('props', props);
  switch (props.type) {
    case DATA_ENTRY.INPUT:
      return <InputC {...props} />;
    case DATA_ENTRY.FORMOTHERC:
      return <FormOtherC {...props} />;
    // case DATA_ENTRY.FORMINFO:
    //   return <FormInfoC {...props} />;
    // case DATA_ENTRY.FORMUPLOAD:
    //   return <FormUpLoadC {...props} />;
    case DATA_ENTRY.INPUTNUMBER:
      return <InputNumberC {...props} />;
    case DATA_ENTRY.SELECT:
      return <SelectC {...props} />;
    case DATA_ENTRY.TREESELECT:
      return <TreeSelectC {...props} />;
    case DATA_ENTRY.SINGLEDATE:
      return <SingleDateC {...props} />;
    case DATA_ENTRY.SIMPLEWEEK:
      return <SimpleWeekC {...props} />;
    case DATA_ENTRY.SIMPLERANGEDATE:
      return <SimpleRangeDateC {...props} />;
    case DATA_ENTRY.COMPLEXDATE:
      return <ComplexDateC {...props} />;
    case DATA_ENTRY.RANGEDATE:
      return <RangeDateC {...props} />;
    case DATA_ENTRY.PRODUCTGROUPTREE:
      return <ProductGroupTreeC {...props} />;
    case DATA_ENTRY.PRODUCTLIST:
      return <ProductListC {...props} />;
    case DATA_ENTRY.PRODUCTGROUPSEP:
      return <ProductGroupSepC {...props} />;
    case DATA_ENTRY.PRODUCTGROUP:
      return <ProductGroupC {...props} />;
    case DATA_ENTRY.SECURITIESCODE:
      return <SecuritiesCodeC {...props} />;
    case DATA_ENTRY.BENCHMARK:
      return <BenchMarkC {...props} />;
    case DATA_ENTRY.SERIESPRODUCTS:
      return <SeriesProductsC {...props} />;
    case DATA_ENTRY.RANGESELECT:
      return <RangeSelectC {...props} />;
    case DATA_ENTRY.TRADINGCOMPANY:
      return <TradingCompanyC {...props} />;
    case DATA_ENTRY.TRADINGDIRECT:
      return <TradingDirectC {...props} />;
    case DATA_ENTRY.TRADINGMARKET:
      return <TradingMarketC {...props} />;
    case DATA_ENTRY.TRADINGTYPE:
      return <TradingTypeC {...props} />;
    case DATA_ENTRY.WINBONDTYPE:
      return <WinBondTypeC {...props} />;
    case DATA_ENTRY.TENANT:
      return <TenantC {...props} />;
    case DATA_ENTRY.TENANTDEPARTMENT:
      return <TenantDepartmentC {...props} />;
    case DATA_ENTRY.RATERANGEC:
      return <RateRangeC {...props} />;
    case DATA_ENTRY.INDUSTRYC:
      return <IndustryC {...props} />;
    case DATA_ENTRY.FUNDAPPLICATIONINDUSTRYC:
      return <FundApplicationIndustryC {...props} />;
    case DATA_ENTRY.SPPIRESULTC:
      return <SppIResultC {...props} />;
    // case DATA_ENTRY.BUSINESSTYPE:
    // return <BusinessTypeC {...props} />;
    case DATA_ENTRY.SERIESPRODUCTGROUP:
      return <SeriesProductGroupC {...props} />; // 系列产品+名称
    case DATA_ENTRY.BUSINESSTARGETC:
      return <BusinessTargetC {...props} />; // 业务目标结果
    case DATA_ENTRY.ADDRESSC:
      return <AddressC {...props} />;
    case DATA_ENTRY.SIMPLEQUARTERC:
      return <SimpleQuarterC {...props} />;
    case DATA_ENTRY.SEARCHANDSELECTC:
      return <SearchAndSelectC {...props} />;
    case DATA_ENTRY.HOlDDATERANGEC:
      return <HoldDateRangeC {...props} />;

    default:
      return <InputC {...props} />;
  }
};

export default FormItems;
